<?php
include('../../include/functions.inc.php');
include('../../include/report.inc.php');
$report = new Report;
$report = unserialize($_SESSION[$report->sessionName]);
$report->dbManager = $db;
if (getParam("flag") != null || $report->ajax || $report->preLoaded) { //si hay submit o es ajax request
    $report->load();
}
if (!$report->ajax) {
    ?>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <title><?php echo $report->titulo; ?></title>
            <link href="../../bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
            <link href="../../css/ContentStyle.css" rel="stylesheet" type="text/css" />
            <link href="../../css/tableorderer.css" rel="stylesheet" type="text/css" />
            <link href="../../css/reports.css" rel="stylesheet" type="text/css" />
            <script src="../../js/jquery.js" type="text/javascript"></script>
            <script>jQuery.noConflict();</script>
            <script src="../../bootstrap/js/bootstrap.js"></script>
        </head>

        <body>
            <?php if ($report->requireFilter) { ?>
                <div id="filter"><form id="report" name="report" method="GET" action="report.php">
                        <input  type="hidden" name="flag" value="do"/>
                        <table class=""  width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <th scope="col"><?php echo $report->titulo; ?></th>
                            </tr>
                            <tr>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <?php echo $report->buildFields(); ?>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td><input name="buscar" type="submit" class="btn btn-info" id="1" onClick="datosEstud(this);" value="Buscar" /></td>
                            </tr>
                        </table>
                    </form></div>&nbsp;
            <?php } ?>
        <?php } ?>
        <?php
        //echo $report->sql;
        echo $report->buildTable("table table-hover table-bordered table-striped", "data line0", "data line1");
        ?>

        <?php if (!$report->ajax) { ?>
        </body>
    </html>
    <?php
}?>